//============================================================================
// Name        : Sorting.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
#include "LinkedList.h"

void quicksort(int elements[]);

int main()
{
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!

	int elements[10] =
	{ 1, 5, 6, 2, 1, 2, 9, 40, 25, 1 };

	quicksort(elements);

	return 0;
}

void quicksort(int elements[])
{
	int pivot = 4;
	int rightSide = 9;
	int index = 0;

	while (index <= rightSide)
	{
		while (elements[index] >= pivot)
		{
			if (elements[rightSide] <= pivot)
			{
				int temporary = elements[index];
				elements[index] = elements[rightSide];
				elements[rightSide] = temporary;
			}
			rightSide--;
		}
		++index;
	}



	for (int index = 0; index <= 9; index++)
	{
		cout << "\n" << elements[index];
	}

}
